export const fullScreen = (element) => {
    if (document.mozFullScreenEnabled) {
        return Promise.reject(new Error("全屏模式被禁用"));
    }

    let result = null;
    if (element.requestFullscreen) {
        result = element.requestFullscreen();
    } else if (element.mozRequestFullScreen) {
        result = element.mozRequestFullScreen();
    } else if (element.msRequestFullscreen) {
        result = element.msRequestFullscreen();
    } else if (element.webkitRequestFullscreen) {
        result = element.webkitRequestFullscreen();
    }

    return result || Promise.reject(new Error("不支持全屏"));
};